import request from '@/utils/request'

// 获取系统环境
export function systemInfo() {
    return request.get({ url: '/monitor/server' })
}

// 获取系统日志列表
export function systemLogLists(params: any) {
    return request.get({ url: '/system/log/operate', params })
}

// 系统缓存监控
export function systemCache() {
    return request.get({ url: '/monitor/cache' })
}

// 定时任务列表
export const apiCrontabLists = () => request.get({ url: '/system/cron/list' })

// 添加定时任务
export const apiCrontabAdd = (params: any) => request.post({ url: '/crontab.crontab/add', params })

// 查看详情
export const apiCrontabDetail = (params: any) =>
    request.get({ url: '/system/cron/detail', params })

// 编辑定时任务
export const apiCrontabEdit = (params: any) =>
    request.post({ url: '/system/cron/edit', params })

// 删除定时任务
export const apiCrontabDel = (params: any) =>
    request.post({ url: '/system/cron/del', params })

// 获取规则执行时间
export const apiCrontabExpression = (params: any) =>
    request.get({ url: '/crontab.crontab/expression', params })

// 操作定时任务
export const apiSrontabOperate = (params: any) =>
    request.post({ url: '/crontab.crontab/operate', params })
